#!/usr/bin/perl -wT
use CGI qw(:standard);
use lib '.';
use users;
use strict;

binmode STDOUT, ":utf8";
#use utf8;
 
use JSON;
require "doa_subs.pl";


my ($username,$level) = &validate;
#warn "$username $level";
my $user_level="a User";
if ($level < 10 ) 
{
	$user_level="a Super User";
}
if ($level < 5 ) 
{
	$user_level="an Administrator";
}

my $outdata=readJSON("mapfile.json");

print header;
print start_html("Musketeers (shoreline) Main Menu");

print h2( {-align => "CENTER"}, "UNDER CONSTRUCTION");
print h3( {-align => "CENTER"},"welcome $username - you are logged in as $user_level");
print <<EOF;
<br>
<table border="1" cellpadding="2" cellspacing="2" width="80%"
align="center">
<tbody>
<tr>
<td>
<p align="center">This Website is for the use of members of
the Musketeers Alliance <b>only</b>.</p>
</td>
</tr>
<tr align="left">
<td>The Purpose of the website is to provide Lords and Team
leaders with the ability to plan co-ordinated attacks on
other alliance's or individual players.<br>
<br>
To do this, up to date information on the location and
strength of all players in this realm is regularly gathered
and stored here. With this information Lords and Team
leaders can assign tasks to participating members based on
strength and location.<br>
</td>
</tr>
</tbody>
</table>
<br>
<hr>
<h3 align="center">Below are a number of ways the information held
in the system can be viewed.</h3>
<table border="1" cellpadding="2" cellspacing="2" height="196"
width="794" align="center">
<tbody>
<tr>
<td> To list all known Alliances click <a
href="listAlliance2.pl">here</a> </td>
</tr>
<tr>
<td>If you know the name of the alliance you want to find,
Enter it in the box below<br>
<form action="findalliance2.pl" method="get"><b>Alliance
Name </b><input name="search" size="30" type="text"> <input
type="submit"></form>
</td>
</tr>
<tr>
<td>If you want to find a particular player (and the system
knows the player name) use this option.
<form action="findplayer2.pl" method="get">&nbsp;&nbsp;
<b>Player Name</b> <input name="search" size="30"
type="text"> <input type="submit"><br>
</form>
</td>
</tr>
<tr>
<td valign="top">To list all players who are NOT in an
Alliance click <a href="listnonalli2.pl">here</a>
(not working yet)<br>
</td>
</tr>
</tbody>
</table>
<br>
<hr>
EOF
if ($level <10 )
{
	print h3( {-align => "CENTER"}, "The next three option are for updating the map after scanning it.");
	print <<FOE;
 <table border="1" cellpadding="2" cellspacing="2" height="58"
width="276" align="center">
<tbody>
<tr>
<td>To Upload a map file click <a href="uploadmap2.pl">here</a><br>
</td>
</tr>
<tr>
<td> To Process a map file click <a
href="processmap2.pl">here</a>(Should now be
working - takes about a minute to show anything on screen)<br>
</td>
</tr>
<tr>
<td valign="top">Map Scanner Install help <a
href="/install.html">here</a></td>
</tr>
</tbody>
</table>
<br>
<hr>
FOE

}

if ($level <5 )
{
print <<EOF2;
 <h3 align="center">These options are for Administrators <b>ONLY</b></h3>
<table border="1" cellpadding="2" cellspacing="2" height="112"
width="312" align="center">
<tbody>
<tr>
<td>User Administration <a
href="admin.pl">here</a></td>
</tr>
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td>Upload a html file to docroot <a
href="uploadhtml2.pl">here</a></td>
</tr>
<tr>
<td>Upload a pl file <a href="uploadpl2.pl">here</a></td>
</tr>
<tr>
<td>Upload a data file <a href="uploaddata2.pl">here</a></td>
</tr>
<tr>
<td>Log file viewer <a href="logviewer2.pl">here</a></td>
</tr>
</tbody>
</table>
<p> </p>
EOF2
}

print a( {-href=>"logout.cgi"}, "log out of your account");
print br();
print a( {-href=>"/passchg.html"}, "change your password");
print end_html;

